home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / tusrc.zip / CONFIG~1 < prev    next >
Text File  |  1993-09-18  |  25KB  |  1,106 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  74.        verbose=yes ;;
  75.  
  76.      *) ;;
  77.     esac
  78.   fi
  79. done
  80.  
  81. trap 'rm -f conftest* core; exit 1' 1 3 15
  82.  
  83. # Needed for some versions of `tr' so that character classes in `[]' work.
  84. if test "${LANG+set}" = "set" ; then
  85.    LANG=C
  86. fi
  87.  
  88. rm -f conftest*
  89. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  90.  
  91. # A filename unique to this package, relative to the directory that
  92. # configure is in, which we can look for to find out if srcdir is correct.
  93. unique_file=src/fold.c
  94.  
  95. # Find the source files, if location was not specified.
  96. if test -z "$srcdir"; then
  97.   srcdirdefaulted=yes
  98.   # Try the directory containing this script, then `..'.
  99.   prog=$0
  100.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  101.   test "X$confdir" = "X$prog" && confdir=.
  102.   srcdir=$confdir
  103.   if test ! -r $srcdir/$unique_file; then
  104.     srcdir=..
  105.   fi
  106. fi
  107. if test ! -r $srcdir/$unique_file; then
  108.   if test x$srcdirdefaulted = xyes; then
  109.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  110.   else
  111.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  112.   fi
  113.   exit 1
  114. fi
  115. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  116. # But we can't avoid them for `..', to make subdirectories work.
  117. case $srcdir in
  118.   .|/*|~*) ;;
  119.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  120. esac
  121.  
  122.  
  123. # We want these before the checks, so the checks can modify their values.
  124. test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
  125. test -z "$LDFLAGS" && LDFLAGS=-g
  126.  
  127. if test -z "$CC"; then
  128.   # Extract the first word of `gcc', so it can be a program name with args.
  129.   set dummy gcc; word=$2
  130.   echo checking for $word
  131.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  132.   for dir in $PATH; do
  133.     test -z "$dir" && dir=.
  134.     if test -f $dir/$word; then
  135.       CC="gcc"
  136.       break
  137.     fi
  138.   done
  139.   IFS="$saveifs"
  140. fi
  141. test -z "$CC" && CC="cc"
  142. test -n "$CC" -a -n "$verbose" && echo "    setting CC to $CC"
  143.  
  144. # Find out if we are using GNU C, under whatever name.
  145. cat > conftest.c <<EOF
  146. #ifdef __GNUC__
  147.   yes
  148. #endif
  149. EOF
  150. ${CC-cc} -E conftest.c > conftest.out 2>&1
  151. if egrep yes conftest.out >/dev/null 2>&1; then
  152.   GCC=1 # For later tests.
  153. fi
  154. rm -f conftest*
  155.  
  156.  
  157. # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
  158. test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
  159.  
  160.  
  161. echo checking how to run the C preprocessor
  162. if test -z "$CPP"; then
  163.   CPP='${CC-cc} -E'
  164.   cat > conftest.c <<EOF
  165. #include <stdio.h>
  166. EOF
  167. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  168. if test -z "$err"; then
  169.   :
  170. else
  171.   CPP=/lib/cpp
  172. fi
  173. rm -f conftest*
  174. fi
  175.  
  176. if test -n "$GCC"; then
  177.   echo checking whether -traditional is needed
  178.   pattern="Autoconf.*'x'"
  179.   prog='#include <sgtty.h>
  180. Autoconf TIOCGETP'
  181.   cat > conftest.c <<EOF
  182. $prog
  183. EOF
  184. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  185. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  186.   need_trad=1
  187. fi
  188. rm -f conftest*
  189.  
  190.  
  191.   if test -z "$need_trad"; then
  192.     prog='#include <termio.h>
  193. Autoconf TCGETA'
  194.     cat > conftest.c <<EOF
  195. $prog
  196. EOF
  197. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  198. if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  199.   need_trad=1
  200. fi
  201. rm -f conftest*
  202.  
  203.   fi
  204.   test -n "$need_trad" && CC="$CC -traditional"
  205. fi
  206.  
  207. # Make sure to not get the incompatible SysV /etc/install and
  208. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  209. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  210. # or the AFS install, which mishandles nonexistent args, or
  211. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  212. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  213. # anyway.  Sigh.
  214. if test "z${INSTALL}" = "z" ; then
  215.   echo checking for install
  216.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  217.   for dir in $PATH; do
  218.     test -z "$dir" && dir=.
  219.     case $dir in
  220.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  221.     *)
  222.       if test -f $dir/installbsd; then
  223.     INSTALL="$dir/installbsd -c" # OSF1
  224.     INSTALL_PROGRAM='$(INSTALL)'
  225.     INSTALL_DATA='$(INSTALL) -m 644'
  226.     break
  227.       fi
  228.       if test -f $dir/install; then
  229.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  230.       : # AIX
  231.     else
  232.       INSTALL="$dir/install -c"
  233.       INSTALL_PROGRAM='$(INSTALL)'
  234.       INSTALL_DATA='$(INSTALL) -m 644'
  235.       break
  236.     fi
  237.       fi
  238.       ;;
  239.     esac
  240.   done
  241.   IFS="$saveifs"
  242. fi
  243. INSTALL=${INSTALL-cp}
  244. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  245. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  246.  
  247. if test -z "$RANLIB"; then
  248.   # Extract the first word of `ranlib', so it can be a program name with args.
  249.   set dummy ranlib; word=$2
  250.   echo checking for $word
  251.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  252.   for dir in $PATH; do
  253.     test -z "$dir" && dir=.
  254.     if test -f $dir/$word; then
  255.       RANLIB="ranlib"
  256.       break
  257.     fi
  258.   done
  259.   IFS="$saveifs"
  260. fi
  261. test -z "$RANLIB" && RANLIB=":"
  262. test -n "$RANLIB" -a -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  263.  
  264. echo checking for AIX
  265. cat > conftest.c <<EOF
  266. #ifdef _AIX
  267.   yes
  268. #endif
  269.  
  270. EOF
  271. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  272. if egrep "yes" conftest.out >/dev/null 2>&1; then
  273.   {
  274. test -n "$verbose" && \
  275. echo '    defining' _ALL_SOURCE
  276. DEFS="$DEFS -D_ALL_SOURCE=1"
  277. }
  278.  
  279. fi
  280. rm -f conftest*
  281.  
  282.  
  283. echo checking for minix/config.h
  284. cat > conftest.c <<EOF
  285. #include <minix/config.h>
  286. EOF
  287. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  288. if test -z "$err"; then
  289.   MINIX=1
  290. fi
  291. rm -f conftest*
  292.  
  293. # The Minix shell can't assign to the same variable on the same line!
  294. if test -n "$MINIX"; then
  295.   {
  296. test -n "$verbose" && \
  297. echo '    defining' _POSIX_SOURCE
  298. DEFS="$DEFS -D_POSIX_SOURCE=1"
  299. }
  300.  
  301.   {
  302. test -n "$verbose" && \
  303. echo '    defining' _POSIX_1_SOURCE to be '2'
  304. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  305. }
  306.  
  307.   {
  308. test -n "$verbose" && \
  309. echo '    defining' _MINIX
  310. DEFS="$DEFS -D_MINIX=1"
  311. }
  312.  
  313. fi
  314.  
  315. echo checking for POSIXized ISC
  316. if test -d /etc/conf/kconfig.d &&
  317.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  318. then
  319.   ISC=1 # If later tests want to check for ISC.
  320.   {
  321. test -n "$verbose" && \
  322. echo '    defining' _POSIX_SOURCE
  323. DEFS="$DEFS -D_POSIX_SOURCE=1"
  324. }
  325.  
  326.   if test -n "$GCC"; then
  327.     CC="$CC -posix"
  328.   else
  329.     CC="$CC -Xp"
  330.   fi
  331. fi
  332.  
  333. echo checking for return type of signal handlers
  334. cat > conftest.c <<EOF
  335. #include <sys/types.h>
  336. #include <signal.h>
  337. #ifdef signal
  338. #undef signal
  339. #endif
  340. extern void (*signal ()) ();
  341. int main() { exit(0); }
  342. int t() { int i; }
  343. EOF
  344. if eval $compile; then
  345.   {
  346. test -n "$verbose" && \
  347. echo '    defining' RETSIGTYPE to be 'void'
  348. DEFS="$DEFS -DRETSIGTYPE=void"
  349. }
  350.  
  351. else
  352.   {
  353. test -n "$verbose" && \
  354. echo '    defining' RETSIGTYPE to be 'int'
  355. DEFS="$DEFS -DRETSIGTYPE=int"
  356. }
  357.  
  358. fi
  359. rm -f conftest*
  360.  
  361.  
  362. echo checking for size_t in sys/types.h
  363. echo '#include <sys/types.h>' > conftest.c
  364. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  365. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  366.   :
  367. else
  368.   {
  369. test -n "$verbose" && \
  370. echo '    defining' size_t to be 'unsigned'
  371. DEFS="$DEFS -Dsize_t=unsigned"
  372. }
  373.  
  374. fi
  375. rm -f conftest*
  376.  
  377. prog='/* Ultrix mips cc rejects this.  */
  378. typedef int charset[2]; const charset x;
  379. /* SunOS 4.1.1 cc rejects this.  */
  380. char const *const *ccp;
  381. char **p;
  382. /* AIX XL C 1.02.0.0 rejects this.
  383.    It does not let you subtract one const X* pointer from another in an arm
  384.    of an if-expression whose if-part is not a constant expression */
  385. const char *g = "string";
  386. p = &g + (g ? g-g : 0);
  387. /* HPUX 7.0 cc rejects these. */
  388. ++ccp;
  389. p = (char**) ccp;
  390. ccp = (char const *const *) p;
  391. { /* SCO 3.2v4 cc rejects this.  */
  392.   char *t;
  393.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  394.  
  395.   *t++ = 0;
  396. }
  397. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  398.   int x[] = {25,17};
  399.   const int *foo = &x[0];
  400.   ++foo;
  401. }
  402. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  403.   typedef const int *iptr;
  404.   iptr p = 0;
  405.   ++p;
  406. }
  407. { /* AIX XL C 1.02.0.0 rejects this saying
  408.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  409.   struct s { int j; const int *ap[3]; };
  410.   struct s *b; b->j = 5;
  411. }'
  412. echo checking for working const
  413. cat > conftest.c <<EOF
  414.  
  415. int main() { exit(0); }
  416. int t() { $prog }
  417. EOF
  418. if eval $compile; then
  419.   :
  420. else
  421.   {
  422. test -n "$verbose" && \
  423. echo '    defining' const to be 'empty'
  424. DEFS="$DEFS -Dconst="
  425. }
  426.  
  427. fi
  428. rm -f conftest*
  429.  
  430. if test -n "$GCC"; then
  431. {
  432. test -n "$verbose" && \
  433. echo '    defining' HAVE_LONG_DOUBLE
  434. DEFS="$DEFS -DHAVE_LONG_DOUBLE=1"
  435. }
  436.  
  437. else
  438. echo checking for long double
  439. cat > conftest.c <<EOF
  440.  
  441. int main() { exit(0); }
  442. int t() { } long double foo() { }
  443. EOF
  444. if eval $compile; then
  445.   {
  446. test -n "$verbose" && \
  447. echo '    defining' HAVE_LONG_DOUBLE
  448. DEFS="$DEFS -DHAVE_LONG_DOUBLE=1"
  449. }
  450.  
  451. fi
  452. rm -f conftest*
  453.  
  454. fi
  455.  
  456. echo checking for ANSI C header files
  457. cat > conftest.c <<EOF
  458. #include <stdlib.h>
  459. #include <stdarg.h>
  460. #include <string.h>
  461. #include <float.h>
  462. EOF
  463. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  464. if test -z "$err"; then
  465.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  466. echo '#include <string.h>' > conftest.c
  467. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  468. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  469.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  470. cat > conftest.c <<EOF
  471. #include <ctype.h>
  472. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  473. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  474. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  475. int main () { int i; for (i = 0; i < 256; i++)
  476. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  477. exit (0); }
  478.  
  479. EOF
  480. eval $compile
  481. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  482.   {
  483. test -n "$verbose" && \
  484. echo '    defining' STDC_HEADERS
  485. DEFS="$DEFS -DSTDC_HEADERS=1"
  486. }
  487.  
  488. fi
  489. rm -f conftest*
  490. fi
  491. rm -f conftest*
  492.  
  493. fi
  494. rm -f conftest*
  495.  
  496. echo checking for unistd.h
  497. cat > conftest.c <<EOF
  498. #include <unistd.h>
  499. EOF
  500. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  501. if test -z "$err"; then
  502.   {
  503. test -n "$verbose" && \
  504. echo '    defining' HAVE_UNISTD_H
  505. DEFS="$DEFS -DHAVE_UNISTD_H=1"
  506. }
  507.  
  508. fi
  509. rm -f conftest*
  510.  
  511. echo checking byte ordering
  512. cat > conftest.c <<EOF
  513. main () {
  514.   /* Are we little or big endian?  From Harbison&Steele.  */
  515.   union
  516.   {
  517.     long l;
  518.     char c[sizeof (long)];
  519.   } u;
  520.   u.l = 1;
  521.   exit (u.c[sizeof (long) - 1] == 1);
  522. }
  523. EOF
  524. eval $compile
  525. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  526.   :
  527. else
  528.   {
  529. test -n "$verbose" && \
  530. echo '    defining' WORDS_BIGENDIAN
  531. DEFS="$DEFS -DWORDS_BIGENDIAN=1"
  532. }
  533.  
  534. fi
  535. rm -f conftest*
  536.  
  537. for hdr in limits.h string.h memory.h fcntl.h
  538. do
  539. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  540. echo checking for ${hdr}
  541. cat > conftest.c <<EOF
  542. #include <${hdr}>
  543. EOF
  544. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  545. if test -z "$err"; then
  546.   {
  547. test -n "$verbose" && \
  548. echo '    defining' ${trhdr}
  549. DEFS="$DEFS -D${trhdr}=1"
  550. }
  551.  
  552. fi
  553. rm -f conftest*
  554. done
  555.  
  556. for func in bcopy memcmp memset stpcpy strtoul
  557. do
  558. echo checking for ${func}
  559. cat > conftest.c <<EOF
  560.  
  561. int main() { exit(0); }
  562. int t() { /* The GNU C library defines this for functions which it implements
  563.     to always fail with ENOSYS.  Some functions are actually named
  564.     something starting with __ and the normal name is an alias.  */
  565. #if defined (__stub_${func}) || defined (__stub___${func})
  566. choke me
  567. #else
  568. /* Override any gcc2 internal prototype to avoid an error.  */
  569. extern char ${func}(); ${func}();
  570. #endif
  571.  }
  572. EOF
  573. if eval $compile; then
  574.   :
  575. else
  576.   LIBOBJS="$LIBOBJS ${func}.o"
  577. test -n "$verbose" && echo "    using ${func}.o instead"
  578. fi
  579. rm -f conftest*
  580.  
  581. done
  582.  
  583. echo "checking if memcmp is 8-bit clean"
  584. cat > conftest.c <<EOF
  585.  
  586. main()
  587. {
  588.   char c1 = 0x80, c2 = 0x81;
  589.   exit(memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
  590. }
  591.  
  592. EOF
  593. eval $compile
  594. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  595.   
  596. test -n "$verbose" && echo memcmp is 8-bit clean
  597.  
  598. else
  599.   
  600. test -n "$verbose" && echo memcmp is NOT 8-bit clean -- using replacement
  601. case "$LIBOBJS" in
  602. *memcmp*) ;;
  603. *) LIBOBJS="$LIBOBJS memcmp.o" ;;
  604. esac
  605.  
  606. fi
  607. rm -f conftest*
  608. for func in strerror
  609. do
  610. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  611. echo checking for ${func}
  612. cat > conftest.c <<EOF
  613. #include <ctype.h>
  614. int main() { exit(0); }
  615. int t() { 
  616. /* The GNU C library defines this for functions which it implements
  617.     to always fail with ENOSYS.  Some functions are actually named
  618.     something starting with __ and the normal name is an alias.  */
  619. #if defined (__stub_${func}) || defined (__stub___${func})
  620. choke me
  621. #else
  622. /* Override any gcc2 internal prototype to avoid an error.  */
  623. extern char ${func}(); ${func}();
  624. #endif
  625.  }
  626. EOF
  627. if eval $compile; then
  628.   {
  629. test -n "$verbose" && \
  630. echo '    defining' ${trfunc}
  631. DEFS="$DEFS -D${trfunc}=1"
  632. }
  633.  
  634. fi
  635. rm -f conftest*
  636. done
  637.  
  638. echo checking for vprintf
  639. cat > conftest.c <<EOF
  640.  
  641. int main() { exit(0); }
  642. int t() { vprintf(); }
  643. EOF
  644. if eval $compile; then
  645.   {
  646. test -n "$verbose" && \
  647. echo '    defining' HAVE_VPRINTF
  648. DEFS="$DEFS -DHAVE_VPRINTF=1"
  649. }
  650.  
  651. else
  652.   vprintf_missing=1
  653. fi
  654. rm -f conftest*
  655.  
  656. if test -n "$vprintf_missing"; then
  657. echo checking for _doprnt
  658. cat > conftest.c <<EOF
  659.  
  660. int main() { exit(0); }
  661. int t() { _doprnt(); }
  662. EOF
  663. if eval $compile; then
  664.   {
  665. test -n "$verbose" && \
  666. echo '    defining' HAVE_DOPRNT
  667. DEFS="$DEFS -DHAVE_DOPRNT=1"
  668. }
  669.  
  670. fi
  671. rm -f conftest*
  672.  
  673. fi
  674.  
  675. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  676. # for constant arguments.  Useless!
  677. echo checking for working alloca.h
  678. cat > conftest.c <<EOF
  679. #include <alloca.h>
  680. int main() { exit(0); }
  681. int t() { char *p = alloca(2 * sizeof(int)); }
  682. EOF
  683. if eval $compile; then
  684.   {
  685. test -n "$verbose" && \
  686. echo '    defining' HAVE_ALLOCA_H
  687. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  688. }
  689.  
  690. fi
  691. rm -f conftest*
  692.  
  693. decl="#ifdef __GNUC__
  694. #define alloca __builtin_alloca
  695. #else
  696. #if HAVE_ALLOCA_H
  697. #include <alloca.h>
  698. #else
  699. #ifdef _AIX
  700.  #pragma alloca
  701. #else
  702. char *alloca ();
  703. #endif
  704. #endif
  705. #endif
  706. "
  707. echo checking for alloca
  708. cat > conftest.c <<EOF
  709. $decl
  710. int main() { exit(0); }
  711. int t() { char *p = (char *) alloca(1); }
  712. EOF
  713. if eval $compile; then
  714.   :
  715. else
  716.   alloca_missing=1
  717. cat > conftest.c <<EOF
  718.  
  719. #if defined(CRAY) && ! defined(CRAY2)
  720. winnitude
  721. #else
  722. lossage
  723. #endif
  724.  
  725. EOF
  726. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  727. if egrep "winnitude" conftest.out >/dev/null 2>&1; then
  728.   echo checking for _getb67
  729. cat > conftest.c <<EOF
  730. #include <ctype.h>
  731. int main() { exit(0); }
  732. int t() { 
  733. /* The GNU C library defines this for functions which it implements
  734.     to always fail with ENOSYS.  Some functions are actually named
  735.     something starting with __ and the normal name is an alias.  */
  736. #if defined (__stub__getb67) || defined (__stub____getb67)
  737. choke me
  738. #else
  739. /* Override any gcc2 internal prototype to avoid an error.  */
  740. extern char _getb67(); _getb67();
  741. #endif
  742.  }
  743. EOF
  744. if eval $compile; then
  745.   {
  746. test -n "$verbose" && \
  747. echo '    defining' CRAY_STACKSEG_END to be '_getb67'
  748. DEFS="$DEFS -DCRAY_STACKSEG_END=_getb67"
  749. }
  750.  
  751. else
  752.   echo checking for GETB67
  753. cat > conftest.c <<EOF
  754. #include <ctype.h>
  755. int main() { exit(0); }
  756. int t() { 
  757. /* The GNU C library defines this for functions which it implements
  758.     to always fail with ENOSYS.  Some functions are actually named
  759.     something starting with __ and the normal name is an alias.  */
  760. #if defined (__stub_GETB67) || defined (__stub___GETB67)
  761. choke me
  762. #else
  763. /* Override any gcc2 internal prototype to avoid an error.  */
  764. extern char GETB67(); GETB67();
  765. #endif
  766.  }
  767. EOF
  768. if eval $compile; then
  769.   {
  770. test -n "$verbose" && \
  771. echo '    defining' CRAY_STACKSEG_END to be 'GETB67'
  772. DEFS="$DEFS -DCRAY_STACKSEG_END=GETB67"
  773. }
  774.  
  775. else
  776.   echo checking for getb67
  777. cat > conftest.c <<EOF
  778. #include <ctype.h>
  779. int main() { exit(0); }
  780. int t() { 
  781. /* The GNU C library defines this for functions which it implements
  782.     to always fail with ENOSYS.  Some functions are actually named
  783.     something starting with __ and the normal name is an alias.  */
  784. #if defined (__stub_getb67) || defined (__stub___getb67)
  785. choke me
  786. #else
  787. /* Override any gcc2 internal prototype to avoid an error.  */
  788. extern char getb67(); getb67();
  789. #endif
  790.  }
  791. EOF
  792. if eval $compile; then
  793.   {
  794. test -n "$verbose" && \
  795. echo '    defining' CRAY_STACKSEG_END to be 'getb67'
  796. DEFS="$DEFS -DCRAY_STACKSEG_END=getb67"
  797. }
  798.  
  799. fi
  800. rm -f conftest*
  801.  
  802. fi
  803. rm -f conftest*
  804.  
  805. fi
  806. rm -f conftest*
  807.  
  808. fi
  809. rm -f conftest*
  810.  
  811.  
  812. fi
  813. rm -f conftest*
  814.  
  815. if test -n "$alloca_missing"; then
  816.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  817.   # that cause trouble.  Some versions do not even contain alloca or
  818.   # contain a buggy version.  If you still want to use their alloca,
  819.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  820.   ALLOCA=alloca.o
  821.  
  822.   echo 'checking stack direction for C alloca'
  823.   echo checking whether cross-compiling
  824. # If we cannot run a trivial program, we must be cross compiling.
  825. cat > conftest.c <<EOF
  826. main(){exit(0);}
  827. EOF
  828. eval $compile
  829. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  830.   :
  831. else
  832.   cross_compiling=1
  833. fi
  834. rm -f conftest*
  835.  
  836. if test -n "$cross_compiling"
  837. then
  838.   {
  839. test -n "$verbose" && \
  840. echo '    defining' STACK_DIRECTION to be '0'
  841. DEFS="$DEFS -DSTACK_DIRECTION=0"
  842. }
  843.  
  844. else
  845. cat > conftest.c <<EOF
  846. find_stack_direction ()
  847. {
  848.   static char *addr = 0;
  849.   auto char dummy;
  850.   if (addr == 0)
  851.     {
  852.       addr = &dummy;
  853.       return find_stack_direction ();
  854.     }
  855.   else
  856.     return (&dummy > addr) ? 1 : -1;
  857. }
  858. main ()
  859. {
  860.   exit (find_stack_direction() < 0);
  861. }
  862. EOF
  863. eval $compile
  864. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  865.   {
  866. test -n "$verbose" && \
  867. echo '    defining' STACK_DIRECTION to be '1'
  868. DEFS="$DEFS -DSTACK_DIRECTION=1"
  869. }
  870.  
  871. else
  872.   {
  873. test -n "$verbose" && \
  874. echo '    defining' STACK_DIRECTION to be '-1'
  875. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  876. }
  877.  
  878. fi
  879. fi
  880. rm -f conftest*
  881. fi
  882.  
  883. echo checking for st_blksize in struct stat
  884. cat > conftest.c <<EOF
  885. #include <sys/types.h>
  886. #include <sys/stat.h>
  887. int main() { exit(0); }
  888. int t() { struct stat s; s.st_blksize; }
  889. EOF
  890. if eval $compile; then
  891.   {
  892. test -n "$verbose" && \
  893. echo '    defining' HAVE_ST_BLKSIZE
  894. DEFS="$DEFS -DHAVE_ST_BLKSIZE=1"
  895. }
  896.  
  897. fi
  898. rm -f conftest*
  899.  
  900. echo checking for directory library header
  901. dirheader=
  902. if test -z "$dirheader"; then
  903.   echo checking for dirent.h
  904. cat > conftest.c <<EOF
  905. #include <sys/types.h>
  906. #include <dirent.h>
  907. int main() { exit(0); }
  908. int t() { DIR *dirp = opendir ("/"); }
  909. EOF
  910. if eval $compile; then
  911.   {
  912. test -n "$verbose" && \
  913. echo '    defining' DIRENT
  914. DEFS="$DEFS -DDIRENT=1"
  915. }
  916.  dirheader=dirent.h
  917. fi
  918. rm -f conftest*
  919. fi
  920. if test -z "$dirheader"; then
  921.   echo checking for sys/ndir.h
  922. cat > conftest.c <<EOF
  923. #include <sys/types.h>
  924. #include <sys/ndir.h>
  925. int main() { exit(0); }
  926. int t() { DIR *dirp = opendir ("/"); }
  927. EOF
  928. if eval $compile; then
  929.   {
  930. test -n "$verbose" && \
  931. echo '    defining' SYSNDIR
  932. DEFS="$DEFS -DSYSNDIR=1"
  933. }
  934.  dirheader=sys/ndir.h
  935. fi
  936. rm -f conftest*
  937. fi
  938. if test -z "$dirheader"; then
  939.   echo checking for sys/dir.h
  940. cat > conftest.c <<EOF
  941. #include <sys/types.h>
  942. #include <sys/dir.h>
  943. int main() { exit(0); }
  944. int t() { DIR *dirp = opendir ("/"); }
  945. EOF
  946. if eval $compile; then
  947.   {
  948. test -n "$verbose" && \
  949. echo '    defining' SYSDIR
  950. DEFS="$DEFS -DSYSDIR=1"
  951. }
  952.  dirheader=sys/dir.h
  953. fi
  954. rm -f conftest*
  955. fi
  956. if test -z "$dirheader"; then
  957.   echo checking for ndir.h
  958. cat > conftest.c <<EOF
  959. #include <sys/types.h>
  960. #include <ndir.h>
  961. int main() { exit(0); }
  962. int t() { DIR *dirp = opendir ("/"); }
  963. EOF
  964. if eval $compile; then
  965.   {
  966. test -n "$verbose" && \
  967. echo '    defining' NDIR
  968. DEFS="$DEFS -DNDIR=1"
  969. }
  970.  dirheader=ndir.h
  971. fi
  972. rm -f conftest*
  973. fi
  974.  
  975. echo checking for closedir return value
  976. cat > conftest.c <<EOF
  977. #include <sys/types.h>
  978. #include <$dirheader>
  979. int closedir(); main() { exit(closedir(opendir(".")) != 0); }
  980. EOF
  981. eval $compile
  982. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  983.   :
  984. else
  985.   {
  986. test -n "$verbose" && \
  987. echo '    defining' VOID_CLOSEDIR
  988. DEFS="$DEFS -DVOID_CLOSEDIR=1"
  989. }
  990.  
  991. fi
  992. rm -f conftest*
  993.  
  994. echo checking for Xenix
  995. cat > conftest.c <<EOF
  996. #if defined(M_XENIX) && !defined(M_UNIX)
  997.   yes
  998. #endif
  999.  
  1000. EOF
  1001. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  1002. if egrep "yes" conftest.out >/dev/null 2>&1; then
  1003.   XENIX=1
  1004. fi
  1005. rm -f conftest*
  1006.  
  1007. if test -n "$XENIX"; then
  1008.   LIBS="$LIBS -lx"
  1009.   case "$DEFS" in
  1010.   *SYSNDIR*) ;;
  1011.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  1012.   esac
  1013. fi
  1014.  
  1015. if test -n "$prefix"; then
  1016.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  1017.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  1018. fi
  1019. if test -n "$exec_prefix"; then
  1020.   prsub="$prsub
  1021. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  1022. exec_prefix\\1=\\2$exec_prefix%"
  1023. fi
  1024. DEFS="`echo \"$DEFS\" | sed 's%[&\\\]%\\\&%g'`"
  1025.  
  1026. trap 'rm -f config.status; exit 1' 1 3 15
  1027. echo creating config.status
  1028. rm -f config.status
  1029. cat > config.status <<EOF
  1030. #!/bin/sh
  1031. # Generated automatically by configure.
  1032. # Run this file to recreate the current configuration.
  1033. # This directory was configured as follows,
  1034. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1035. #
  1036. # $0 $*
  1037.  
  1038. for arg
  1039. do
  1040.   case "\$arg" in
  1041.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1042.     exec /bin/sh $0 $* ;;
  1043.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  1044.   esac
  1045. done
  1046.  
  1047. trap 'rm -f Makefile lib/Makefile src/Makefile man/Makefile; exit 1' 1 3 15
  1048. CC='$CC'
  1049. CFLAGS='$CFLAGS'
  1050. LDFLAGS='$LDFLAGS'
  1051. CPP='$CPP'
  1052. INSTALL='$INSTALL'
  1053. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  1054. INSTALL_DATA='$INSTALL_DATA'
  1055. RANLIB='$RANLIB'
  1056. LIBOBJS='$LIBOBJS'
  1057. ALLOCA='$ALLOCA'
  1058. LIBS='$LIBS'
  1059. srcdir='$srcdir'
  1060. DEFS='$DEFS'
  1061. prefix='$prefix'
  1062. exec_prefix='$exec_prefix'
  1063. prsub='$prsub'
  1064. EOF
  1065. cat >> config.status <<\EOF
  1066.  
  1067. top_srcdir=$srcdir
  1068.  
  1069. # Allow make-time overrides of the generated file list.
  1070. test -n "$gen_files" || gen_files="Makefile lib/Makefile src/Makefile man/Makefile"
  1071.  
  1072. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  1073.   srcdir=$top_srcdir
  1074.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1075.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  1076.   if test "$dir" != "$file"; then
  1077.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  1078.     test ! -d $dir && mkdir $dir
  1079.   fi
  1080.   echo creating $file
  1081.   rm -f $file
  1082.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  1083.   sed -e "
  1084. $prsub
  1085. s%@CC@%$CC%g
  1086. s%@CFLAGS@%$CFLAGS%g
  1087. s%@LDFLAGS@%$LDFLAGS%g
  1088. s%@CPP@%$CPP%g
  1089. s%@INSTALL@%$INSTALL%g
  1090. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1091. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1092. s%@RANLIB@%$RANLIB%g
  1093. s%@LIBOBJS@%$LIBOBJS%g
  1094. s%@ALLOCA@%$ALLOCA%g
  1095. s%@LIBS@%$LIBS%g
  1096. s%@srcdir@%$srcdir%g
  1097. s%@DEFS@%$DEFS%
  1098. " $top_srcdir/${file}.in >> $file
  1099. fi; done
  1100.  
  1101. exit 0
  1102. EOF
  1103. chmod +x config.status
  1104. test -n "$no_create" || ./config.status
  1105.  
  1106.